import java.io.Serializable;

/**
 * Represents an item that can be purchased in a store or acquired through
 * other means, and added to the current Equipment.
 */
public class Item  implements Serializable
{
	private String name;
	private int weight;
	private int cost; //Represents the cost of the item in cents, so 100 is equivalent to $1.00.
	
	/**
	 * Creates an item with specified name, weight, and cost. If an item will
	 * not be included in weight calculations (such as Oxen, as they are
	 * outside of the wagon), weight can be set to 0.
	 * 
	 * @param name Name for the Item.
	 * @param weight Weight for the Item.
	 * @param cost Cost of the item.
	 */
	public Item(String name, int weight, int cost)
	{
		this.name = name;
		this.weight = weight;
		this.cost = cost;
	}

	/**
	 * Accessor for the name field.
	 * @return Name of the item.
	 */
	public String getName() 
	{
		return name;
	}

	/**
	 * Accessor for the weight field.
	 * @return Weight of the item.
	 */
	public int getWeight() 
	{
		return weight;
	}

	/**
	 * Accessor for the cost field.
	 * @return Cost of the item.
	 */
	public int getCost() 
	{
		return cost;
	}
	
	/**
	 * toString method that returns the string representation of the item object.
	 * @return String representation of the object
	 */
	@Override
	public String toString()
	{
		return name;
	}
}
